package cn.fboost.mtos.mapper;

import cn.fboost.mtos.dto.request.PageRequest;
import cn.fboost.mtos.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProductMapper {
    int create(Product product);
    int update(Product product);
    int deleteById(int id);
    int deleteByCategoryId(int categoryId);
    Product findById(int id);
    List<Product> listByCategoryId(@Param("categoryId") int categoryId, @Param("pagination") PageRequest.PageOffset pagination);
    List<Product> listByMonthlySales(@Param("size") int size, @Param("offShelfFilter") boolean offShelfFilter);
    int countByCategoryId(int id);
    List<Integer> listIds();
    int count();
    List<Product> list(PageRequest.PageOffset pageOffset);
}
